#ifndef __ADC_H
#define __ADC_H

#include "stm32f10x.h"                  // Device header
#include "timer.h"

#define SUM_NUM 10
#define ADC_NUM 6

#define AD48V_1 0
#define AD48V_2 1
#define C1_JB_1 2
#define C1_JB_2 3
#define C2_JB_1 4
#define C2_JB_2 5

#define AD48V1_PIN  GPIO_Pin_5
#define AD48V2_PIN  GPIO_Pin_0
#define C1_JB1_PIN  GPIO_Pin_3  //通道1正向
#define C1_JB2_PIN  GPIO_Pin_4  //通道1反向
#define C2_JB1_PIN  GPIO_Pin_7  //通道2正向
#define C2_JB2_PIN  GPIO_Pin_6  //通道2反向

struct ADC_DATA
{
    uint16_t voltage[6];            //经过滤波后的电压
    float v48_a,v48_b,jb_a,jb_b;    //一元一次线性方程 y=ax+b
};

extern struct ADC_DATA RF_Data;

void ADC_DMA_Init(void);
void MeanFilter(void);

#endif
